home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
program
/
331
/
gemfsc14
/
aessrc14
/
aesutrc3.s
< prev
next >
Wrap
Text File
|
1989-08-26
|
3KB
|
66 lines
;*========================================================================
;*
;* AESFAST Public Domain GEM bindings.
;*
;*========================================================================
;*************************************************************************
;*
;* AESUTRC3.S - Rectangle utilities 3 of 4.
;* Utility routines involving the standard rectangle calcs...
;*
;*************************************************************************
;-------------------------------------------------------------------------
; rc_union
;-------------------------------------------------------------------------
_rc_union::
move.l 4(sp),a1
move.l 8(sp),a0
movem.l d4-d7,-(sp)
; Calc right-side x...
move.w (a1),d1 ; rx1 = x1 + w1
add.w 4(a1),d1
move.w (a0),d7 ; rx2 = x2 + w2
add.w 4(a0),d7
cmp.w d1,d7 ; compare rx1 <-> rx2
bge.s .gotrx ; proper rx is the smaller
move.w d1,d7 ; of the two.
.gotrx:
; Calc bottom y...
move.w 2(a1),d1 ; by1 = y1 + h1
add.w 6(a1),d1
move.w 2(a0),d6 ; by2 = y2 + h2
add.w 6(a0),d6
cmp.w d1,d6 ; compare by1 <-> by2
bge.s .gotby ; proper by is the smaller
move.w d1,d6 ; of the two.
.gotby:
; Calc left-side x...
move.w (a0),d5 ; assume x2
cmp.w (a1),d5 ; compare x1 <-> x2
blt.s .gotlx ; proper lx is smaller
move.w (a1),d5 ; of the two.
.gotlx:
; Calc top y...
move.w 2(a0),d4 ; assume y2
cmp.w 2(a1),d4 ; compare y1 <-> y2
blt.s .gotty ; proper ty is smaller
move.w 2(a1),d4 ; of the two.
.gotty:
; Got all the x/y's...
move.w d5,(a0)+ ; store left x
move.w d4,(a0)+ ; store top y
sub.w d5,d7 ; compute width
move.w d7,(a0)+ ; store it
sub.w d4,d6 ; compute height
move.w d6,(a0)+ ; store it
movem.l (sp)+,d4-d7
tst.w d0 ; insure CCR return matches d0.
rts
; end of code